﻿using Inovout.Cloud.Storage.Models;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;

namespace Inovout.Cloud.Storage.Web.Controllers
{
    public class DownloadController : ObjectsController
    {
        [HttpGet]
        [Route("{bucket}/{storageObject}/GetFilePath")]
        public HttpResponseMessage GetFilePath(string storageObject)
        {
            return base.Content(objectService.Find(Bucket, storageObject).File.Path);
        }

        [HttpGet]
        [Route("down/{bucket}/{storageObject}")]
        public HttpResponseMessage GetFile(string storageObject)
        {
            return DownloadFormLocal(storageObject);
        }  
    }
}